package com.gary.mapper;

import com.gary.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author pengrui
 * @date 2020/11/26 - 16:47
 */
@Mapper
public interface IUserMapper {

    /**
     *  查询所有
     * @return
     */
    @Select("select * from user")
    List<User> queryAll();

    /**
     *  更新用户
     * @param user
     */
    @Update("update user set user_name=#{user.userName}, password=#{user.password} where id=#{user.id}")
    void updateUser(User user);
}
